<template> <h1>注册</h1>
   <table border="1">
        <tbody>
            <tr>
                <td>账号</td>
                <td>
                    <input type="text" v-model="data.Name">
                </td>
            </tr>
            <tr>
                <td>密码</td>
                <td>
                    <input type="text" v-model="data.Pwd">
                </td>
            </tr>
            <tr>
                <td>电话</td>
                <td>
                    <input type="text" v-model="data.Phone">
                </td>
            </tr>
            <tr>
                <td>地址</td>
                <td>
                    <input type="text" v-model="data.Addr">
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <input type="button" value="注册" @click="Add">
                </td>
              
            </tr>
        </tbody>
   </table>
</template>

<script setup lang="ts">
import axios from 'axios';
import { ref } from 'vue';

const data=ref({
        "Id": 0,
        "Name": "",
        "Pwd": "",
        "Phone": "",
        "Addr": ""

})

const Add=()=>{
    axios.post("https://localhost:7011/api/Member/MemberAdd",data.value).then(res=>{
        if(res.data>0){
            alert('添加成功')
            return;
        }
        else{

            alert('添加失败')
            return;
        }
    })
}


</script>

